package com.xzbd.gef.factory;

import org.eclipse.gef.requests.CreationFactory;

import com.xzbd.core.SerializableColor;
import com.xzbd.gef.model.text.NotesNode;
import com.xzbd.gef.model.text.TextNode;

public class PaletteNodeFactory implements CreationFactory{
	
	private Class<?> template;

	public PaletteNodeFactory(Class<?> t) {
		this.template = t;
	}
	

	@Override
	public Object getNewObject() {
		if (template == null) {
			return null;
		}
		if (template == NotesNode.class) {
			NotesNode srv = new NotesNode();
			srv.setName("NOTES");
			srv.setNotes("Add your notes here.");
			srv.setColor(new SerializableColor(255, 255, 255));
			return srv;
		}
		if (template == TextNode.class) {
			TextNode srv = new TextNode();
			srv.setName("TEXT");
			srv.setNotes("Add your text here.");
			srv.setColor(new SerializableColor(255, 255, 255));
			return srv;
		}
		return null;
	}

	@Override
	public Object getObjectType() {
		// TODO Auto-generated method stub
		return null;
	}

}
